package com.hy.demo.ui.tools;

import android.annotation.SuppressLint;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

import com.hy.demo.R;
import com.hy.demo.app.BaseActivity;
import com.hy.demo.util.TTS;
import com.hy.demo.util.WSLog;


public class WsLogActivity extends BaseActivity implements View.OnClickListener {

    private EditText editMsg;

    @Override
    protected int getLayoutId() {
        return R.layout.v_tool_ws;
    }

    @Override
    protected void initView() {
        editMsg = findViewById(R.id.edit_msg);
    }

    @Override
    protected void initData() {
        setTitle(R.string.tools_wslog);
    }

    @SuppressLint("NonConstantResourceId")
    @Override
    public void onClick(View v) {
        String msg = editMsg.getText().toString();
        if (!TextUtils.isEmpty(msg) && msg.startsWith("ws://")) {
            WSLog.getInstance().init(msg);
            WSLog.getInstance().setEnable(true);
        }
    }

}
